package com.mm.cme.kotlin_001.level03_object_oriented_program.delegate

import com.mm.cme.kotlin_001.utils.pl

/**
 * Descriptions：接口代理
 * <p>
 * Author：ChenME
 * Date：2017/7/17
 * Email：ibelieve1210@163.com
 */
class Manger : Driver, Writer {

    override fun drive() {
    }

    override fun write() {
    }
}

class SeniorManger(val driver: Driver, val writer: Writer) : Driver by driver, Writer by writer


class CarDriver : Driver {
    override fun drive() {
        pl("开车呢")
    }
}

class PPTWriter : Writer {
    override fun write() {
        pl("做PPT呢")
    }
}

interface Driver {
    fun drive()
}

interface Writer {
    fun write()
}

fun main(args: Array<String>) {
    val driver = CarDriver()
    val writer = PPTWriter()
    val seniorManger = SeniorManger(driver, writer)
    seniorManger.drive()
    seniorManger.write()
}